import Vue from 'vue';
import Router from 'vue-router';
import Login from '../views/login';
import Main from '../views/main';

Vue.use(Router);

// 路由
export const routes = [
  {
    path: '/',
    redirect: '/main',
  },
  {
    path: '/login',
    component: Login,
    children: [],
  },
  {
    path: '/main',
    component: Main,
    children: [],
  },
]

export default new Router({
  mode: 'history', // 去掉url中的#
  scrollBehavior: () => ({ y: 0 }),
  routes: routes
})
